package com.wtwd.campus.service.impl;

import com.wtwd.campus.common.Constants;
import com.wtwd.campus.dao.WhiteListMapper;
import com.wtwd.campus.entity.DeviceInfo;
import com.wtwd.campus.entity.DeviceWhiteCall;
import com.wtwd.campus.entity.DeviceWhiteList;
import com.wtwd.campus.service.DeviceWhiteListService;
import com.wtwd.campus.service.RedisService;
import com.wtwd.campus.utils.CommandSendUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class DeviceWhiteListServiceImpl implements DeviceWhiteListService {
    @Autowired
    private WhiteListMapper whiteListMapper;

    @Override
    public List<DeviceWhiteList> getAffectionNumberByStuId(Integer stuId) {
        return whiteListMapper.getAffectionNumberByStuId(stuId);
    }

    @Override
    public Integer modifyAffectionNumber(DeviceWhiteList white) {
        //将数据库中该亲情号的状态设置为待修改
        Integer i = whiteListMapper.modifyAffectionNumber( white.getId(), white.getStatus());
        return i;
    }

    @Override
    public DeviceWhiteList getDeviceWhiteListById(Integer id) {
        return whiteListMapper.getDeviceWhiteListById(id);
    }

    @Override
    public Integer addDeviceWhiteList(DeviceWhiteCall deviceWhiteCall) {
        return whiteListMapper.addDeviceWhiteList(deviceWhiteCall);
    }

    @Override
    public String getNumberByWXUserId(Integer userId) {
        return whiteListMapper.getNumberByWXUserId(userId);
    }

    @Override
    public List<DeviceWhiteList> getAffectionNumberByDeviceId(Integer deviceId) {
        return whiteListMapper.getAffectionNumberByDeviceId(deviceId);
    }

    @Override
    public List<Map<String, Object>> getClassModeByDeviceId(Integer stuId) {
        return null;
    }


}
